﻿using System;
using System.IO;

namespace TaskGenerater
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args == null || args.Length == 0)
                return;

            try
            {
                var directory = args[0].Substring(0, args[0].LastIndexOf('\\'));
                File.WriteAllText(args[0], Generater.Generate(directory));
                Console.WriteLine("Generated Success! Press Any key....");
            }
            catch (MyException ex)
            {
                Console.WriteLine(ex.Message);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            Console.ReadKey();
        }
    }
}